import request from '@/utils/request'

// 活动相关接口
export function getActivityList(params) {
  return request({
    url: '/promotion/activity/list',
    method: 'get',
    params
  })
}

export function createActivity(data) {
  return request({
    url: '/promotion/activity/create',
    method: 'post',
    data
  })
}

export function updateActivity(data) {
  return request({
    url: '/promotion/activity/update',
    method: 'post',
    data
  })
}

export function deleteActivity(id) {
  return request({
    url: `/promotion/activity/${id}`,
    method: 'delete'
  })
}

// 优惠券相关接口
export function getCouponList(params) {
  return request({
    url: '/promotion/coupon/list',
    method: 'get',
    params
  })
}

export function createCoupon(data) {
  return request({
    url: '/promotion/coupon/create',
    method: 'post',
    data
  })
}

export function updateCoupon(data) {
  return request({
    url: '/promotion/coupon/update',
    method: 'post',
    data
  })
}

export function deleteCoupon(id) {
  return request({
    url: `/promotion/coupon/${id}`,
    method: 'delete'
  })
}

// 优惠券发放相关接口
export function issueCoupon(data) {
  return request({
    url: '/promotion/coupon/issue',
    method: 'post',
    data
  })
}

export function getCouponIssueLog(params) {
  return request({
    url: '/promotion/coupon/issue/log',
    method: 'get',
    params
  })
}

// 获取用户列表（用于选择发放对象）
export function getUserListForCoupon(params) {
  return request({
    url: '/promotion/coupon/users',
    method: 'get',
    params
  })
} 